

 #ifndef GLWIDGET_H
 #define GLWIDGET_H
 #include "renderTree.h"
 #include <QGLWidget>
// #include "include/dto/3d/rect.h"

 class GLWidget : public QGLWidget
 {
     Q_OBJECT

 public:
     GLWidget(QWidget *parent = 0);
     ~GLWidget();

     QSize minimumSizeHint() const;
     QSize sizeHint() const;
     void setRenderList(std::list<Renderable *> *list);

     void setText(QString _text);
     
 public slots:

     void timerDone();



 protected:
     void initializeGL();
     void paintEvent(QPaintEvent *event);
     void showEvent(QShowEvent *event);
     void setupViewport();
     void resizeGL(int width, int height);
     void mousePressEvent(QMouseEvent *event);
     void mouseMoveEvent(QMouseEvent *event);
     void drawInstructions(QPainter *painter);

 private:
     void makeObject();
     void diamond();
     void pipe();
     void quad(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2,
               GLdouble x3, GLdouble y3, GLdouble x4, GLdouble y4);
     void extrude(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
     void normalizeAngle(int *angle);

     QImage img;
     QImage peter;
     QImage barbara;
     QImage martina;
     GLuint object;
     int xRot;
     int yRot;
     int zRot;
     int pos;
     QPoint lastPos;
     QString text;
     QString text1;
     QString text2;
     QString text3;
     QString text4;
     QString text5;
     RenderTree renderer;
     std::list<Renderable *> *list;
     
     //Rect rect;
     int count;
     
     int textPos;
 };

 #endif 

